#import "FlourishGratitudeController.h"
        
#import "FlourishGratitudeModel.h"
#import "FlourishGratitudeCell.h"
#import "Masonry.h"

@interface FlourishGratitudeController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *nirvanaKaleidoscopeTableView;
@property (nonatomic, strong) NSMutableArray *amberDataSource;

@end

@implementation FlourishGratitudeController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self radiantSetupview];
	[self xylophoneResilientUndertowloadData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)amberDataSource {
	if (!_amberDataSource) {
		_amberDataSource = [NSMutableArray array];
	}
	return _amberDataSource;
}

- (UITableView *)figHandleTableView {
    if (!_nirvanaKaleidoscopeTableView) {
        _nirvanaKaleidoscopeTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _nirvanaKaleidoscopeTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _nirvanaKaleidoscopeTableView.estimatedRowHeight = 0;
        _nirvanaKaleidoscopeTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _nirvanaKaleidoscopeTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _nirvanaKaleidoscopeTableView.delegate = self;
        _nirvanaKaleidoscopeTableView.dataSource = self;
        _nirvanaKaleidoscopeTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _nirvanaKaleidoscopeTableView.showsVerticalScrollIndicator = NO;
        _nirvanaKaleidoscopeTableView.showsHorizontalScrollIndicator = NO;
        _nirvanaKaleidoscopeTableView.backgroundColor = UIColor.clearColor;
    }
    return _nirvanaKaleidoscopeTableView;
}

//: 获取数据模型
- (void)xylophoneResilientUndertowloadData {
	
}

//: 初始化页面UI
- (void)radiantSetupview {

	[self.view addSubview:self.nirvanaKaleidoscopeTableView];
	[self.nirvanaKaleidoscopeTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.amberDataSource.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    FlourishGratitudeCell *balanceDreamscapeUnderwater = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([FlourishGratitudeCell class])];
    if (balanceDreamscapeUnderwater == nil) {
        balanceDreamscapeUnderwater = [[FlourishGratitudeCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([FlourishGratitudeCell class])];
    }
    balanceDreamscapeUnderwater.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return balanceDreamscapeUnderwater;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
